import { isMobileTerminal } from './flexibal'
import { getAliPay, getPayResult } from '@/api/pay'

/**
 * @param {*} subject 支付标题
 * @param {*} body 支付内容
 */

export const useZFBpay = async (subject, body) => {
  const { code, data } = await getAliPay({
    subject,
    totalAmount: '0.01',
    body,
    isMobile: isMobileTerminal.value
  })
  if (code == 200) {
    window.location.href = decodeURIComponent(data.encodeURI)
  }
}
